//
//  VisitorView.swift
//  XLWB
//
//  Created by 郭亮 on 16/3/14.
//  Copyright © 2016年 gl. All rights reserved.
//

import UIKit

class VisitorView: UIView {
    class func visitorView() -> VisitorView {
        return NSBundle.mainBundle().loadNibNamed("VisitorView", owner: nil, options: nil).last as! VisitorView
    }
    
    // MARK:-控件属性
    @IBOutlet weak var registerBtn: UIButton!
    @IBOutlet weak var loginBtn: UIButton!
    @IBOutlet weak var rotationImageView: UIImageView!
    @IBOutlet weak var iconView: UIImageView!
    @IBOutlet weak var tipLable: UILabel!
    
    /// 旋转图片添加动画
    func addRotationAimation() {
        //创建动画
        let animation = CABasicAnimation(keyPath: "transform.rotation.z")
        //设置动画属性
        animation.fromValue = 0;
        animation.toValue = M_PI * 2
        animation.duration = 10.0
        animation.repeatCount = MAXFLOAT
        animation.removedOnCompletion = false
        //添加动画
        rotationImageView.layer.addAnimation(animation, forKey: nil)
    }
    
    ///设置控件属性
    func setupVisitorViewProperty(iconName: String, tipTitle: String) {
        iconView.image = UIImage(named: iconName)
        tipLable.text = tipTitle
        //隐藏旋转图片
        rotationImageView.hidden = true
    }
    
}
